package io;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStreamReader;
import java.nio.charset.StandardCharsets;

//转换流
//测试读取文本数据
public class ISRDemo {
    public static void main(String[] args) throws IOException {
       FileInputStream fileInputStream=new FileInputStream("osw.txt");
       InputStreamReader inputStreamReader=new InputStreamReader(fileInputStream, StandardCharsets.UTF_8);
       int d;
       while ((d=inputStreamReader.read())!=-1){
           System.out.print(((char) d));
       }
       inputStreamReader.close();
    }
}
